
#ifndef __VTY_CLIENT_MANAGER_HPP__
#define __VTY_CLIENT_MANAGER_HPP__ 

#include "khan.hpp"
#include "vty.hpp"
#include "ipc_session.hpp"
#include "vty_ipc_msg.hpp"

class vty_agent_mng;
typedef boost::shared_ptr<vty_agent_mng> vty_agent_mng_ptr;

class vty_agent_mng
: public boost::enable_shared_from_this<vty_agent_mng>,
private boost::noncopyable       
{
public:
    static vty_agent_mng_ptr instance();
    
    ~vty_agent_mng();

    void run(); 
    void stop();

    void register_func(__u64 func_id, ExcuteHandle func);
    ExcuteHandle find_func(__u64 func_id); 

private:
    typedef std::map<__u64, ExcuteHandle> func_map_t;

    vty_agent_mng();
    

    static vty_agent_mng_ptr _instance;
    static boost::mutex _singleton_lock;
    func_map_t  _func_map;
    io_service  _ioserv;
};



#endif /* __VTY_CLIENT_MANAGER_HPP__ */
